home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / dev / e / yaec.lha / examples / DirQuick.e < prev    next >
Text File  |  2001-08-12  |  640b  |  27 lines

  1. /* nice directory command in E ! */
  2.  
  3. MODULE 'dos/dos'
  4.  
  5. PROC main()
  6.   DEF info:fileinfoblock,lock,c=0
  7.   IF lock:=Lock(arg,-2)
  8.     IF Examine(lock,info)
  9.       IF info.direntrytype>0
  10.         WriteF('Directory of: \s\n',info.filename)
  11.         WHILE ExNext(lock,info)
  12.           WriteF(IF info.direntrytype>0 THEN
  13.             '\e[1;32m\l\s[25]\e[0;31m' ELSE '\l\s[17] \r\d[7]',
  14.             info.filename,info.size)
  15.           WriteF(IF c++=2 THEN (c:=0) BUT '\n' ELSE ' ')
  16.         ENDWHILE
  17.         IF c THEN WriteF('\n')
  18.       ELSE
  19.         WriteF('No Dir!\n')
  20.       ENDIF
  21.     ENDIF
  22.     UnLock(lock)
  23.   ELSE
  24.     WriteF('What ?!?\n')
  25.   ENDIF
  26. ENDPROC
  27.